new Vue({
  el: "#app",
  data: {
    isCanClick: true,//下一步是否可点击
    msg: ''//提示
  },
  mounted() {
    // 缓存地址栏 phone 参数
    if (getUrlParam("phone")) {
      local.set("phone", getUrlParam("phone"));
    }
    this.search();
  },
  methods: {
    // 查询信息提示
    search: function () {
      var that = this;
      post('api/enp/user/upgrade').then(function (res) {
        if (res.code && res.code == 200) {
          that.isCanClick = true;
        } else {
          that.isCanClick = false;
          that.msg = res.msg
        }
      })
    },
    // 下一步
    submit: function () {
      if (!this.isCanClick) {
        mui.toast(this.msg)
        return;
      }
      post("api/enp/user/upgrade").then(function (res) {
        if (res.code == 200) {
          window.location.href = "select_index.html"
        }
      })
    }
  }
})